import request from '@/utils/request'

const dictApi = {
    page: '/dictWeb/dictPagination',
    list: '/dictWeb/dictList',
    typeList: '/dictWeb/dictTypeList',
    dictDeleteOrUpdate: '/dictWeb/',
};



export function dictList(params){
    return request({
        url: dictApi.list,
        method: 'get',
        headers: {
          'Content-Type': 'application/json;charset=UTF-8'
        },
        params,
    });
}

export function dictTypeList(params){
    return request({
        url: dictApi.typeList,
        method: 'get',
        headers: {
          'Content-Type': 'application/json;charset=UTF-8'
        },
        params,
    });
}

export function dictPage(params){
    return request({
        url: dictApi.page,
        method: 'get',
        headers: {
          'Content-Type': 'application/json;charset=UTF-8'
        },
        params,
    });
}


export function dictDelete(id){
    return request({
        url: dictApi.dictDeleteOrUpdate+id,
        method: 'DELETE',
        headers: {
          'Content-Type': 'application/json;charset=UTF-8'
        },
    });
}


export function dictUpdate(data){
    return request({
        url: dictApi.dictDeleteOrUpdate,
        method: 'PUT',
        headers: {
          'Content-Type': 'application/json;charset=UTF-8'
        },
        data,
    });
}

export function dictAdd(data){
    return request({
        url: dictApi.dictDeleteOrUpdate,
        method: 'POST',
        headers: {
          'Content-Type': 'application/json;charset=UTF-8'
        },
        data,
    });
}